home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / scfft.z / scfft
Encoding:
Text File  |  2002-10-03  |  32.7 KB  |  727 lines

  1.  
  2.  
  3.  
  4. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SSSSCCCCFFFFFFFFTTTT, DDDDZZZZFFFFFFFFTTTT, CCCCSSSSFFFFFFFFTTTT, ZZZZDDDDFFFFFFFFTTTT - Computes a real-to-complex or complex-to-
  10.      real Fast Fourier Transform (FFT)
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      Single precision -> Single precision complex
  14.  
  15.           Fortran:
  16.                CCCCAAAALLLLLLLL SSSSCCCCFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s))))
  17.  
  18.           C/C++:
  19.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  20.                iiiinnnntttt ssssccccfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ffffllllooooaaaatttt *_x,,,,
  21.                ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  22.  
  23.           C++ STL:
  24.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  25.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  26.                iiiinnnntttt ssssccccfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ffffllllooooaaaatttt *_x,,,,
  27.                ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_y,,,, ffffllllooooaaaatttt*_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  28.  
  29.      Double precision  -> Double precision complex
  30.  
  31.           Fortran:
  32.                CCCCAAAALLLLLLLL DDDDZZZZFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s))))
  33.  
  34.           C/C++:
  35.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  36.                iiiinnnntttt ddddzzzzfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ffffllllooooaaaatttt *_x,,,,
  37.                ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  38.  
  39.           C++ STL:
  40.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  41.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  42.                iiiinnnntttt ddddzzzzfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ddddoooouuuubbbblllleeee *_x,,,,
  43.                ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  44.  
  45.      Single precision complex -> Single precision
  46.  
  47.           Fortran:
  48.                CCCCAAAALLLLLLLL CCCCSSSSFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s))))
  49.  
  50.           C/C++:
  51.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  52.                iiiinnnntttt ccccssssfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,,
  53.                ffffllllooooaaaatttt *_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  54.  
  55.           C++ STL:
  56.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  57.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  58.                iiiinnnntttt ccccssssfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,,
  59.                ffffllllooooaaaatttt *_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      Double precision complex -> Double precision
  75.  
  76.           Fortran:
  77.                CCCCAAAALLLLLLLL ZZZZDDDDFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s))))
  78.  
  79.           C/C++:
  80.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  81.                iiiinnnntttt zzzzddddfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,,
  82.                ddddoooouuuubbbblllleeee *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  83.  
  84.           C++ STL:
  85.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  86.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  87.                iiiinnnntttt zzzzddddfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,,
  88.                ddddoooouuuubbbblllleeee *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  89.  
  90. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  91.      These routines are part of the SCSL Scientific Library and can be loaded
  92.      using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option.  The ----llllssssccccssss____mmmmpppp option
  93.      directs the linker to use the multi-processor version of the library.
  94.  
  95.      When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is
  96.      4 bytes (32 bits). Another version of SCSL is available in which integers
  97.      are 8 bytes (64 bits).  This version allows the user access to larger
  98.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  99.      by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use
  100.      only one of the two versions; 4-byte integer and 8-byte integer library
  101.      calls cannot be mixed.
  102.  
  103.      The C and C++ prototypes shown above are appropriate for the 4-byte
  104.      integer version of SCSL. When using the 8-byte integer version, the
  105.      variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header
  106.      file should be included.
  107.  
  108. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  109.      SSSSCCCCFFFFFFFFTTTT/DDDDZZZZFFFFFFFFTTTT computes the FFT of the real array _X, and it stores the
  110.      results in the complex array _Y.  CCCCSSSSFFFFFFFFTTTT/ZZZZDDDDFFFFFFFFTTTT computes the corresponding
  111.      inverse complex-to-real transform.
  112.  
  113.      It is customary in FFT applications to use zero-based subscripts; the
  114.      formulas are simpler that way.  For these routines, suppose that the
  115.      arrays are declared as follows:
  116.  
  117.           Fortran:
  118.  
  119.                REAL    X(0:n-1)
  120.                COMPLEX Y(0:n/2)
  121.  
  122.  
  123.           C/C++:
  124.  
  125.                float        x[n];
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  137.  
  138.  
  139.  
  140.                scsl_complex y[n/2+1];
  141.  
  142.  
  143.           C++ STL:
  144.  
  145.                float          x[n];
  146.                complex<float> y[n/2+1];
  147.  
  148.  
  149.      Then the output array is the FFT of the input array, using the following
  150.      formula for the FFT:
  151.  
  152.  
  153.  
  154.                          n-1
  155.           Y(k) = scale * Sum [ X(j)*w**(isign*j*k) ] for k = 0, ..., n/2
  156.                          j=0
  157.  
  158.           where:
  159.  
  160.      _w =       exp(2*_p_i*_i/_n),
  161.  
  162.      _i =       + sqrt(-1),
  163.  
  164.      _p_i =      3.14159...,
  165.  
  166.      _i_s_i_g_n =   +1 or -1.
  167.  
  168.      Different authors use different conventions for which of the transforms,
  169.      _i_s_i_g_n = +1 or _i_s_i_g_n = -1, is the forward or inverse transform, and what
  170.      the _s_c_a_l_e factor should be in either case.  You can make these routines
  171.      compute any of the various possible definitions, however, by choosing the
  172.      appropriate values for _i_s_i_g_n and _s_c_a_l_e.
  173.  
  174.      The relevant fact from FFT theory is this:  If you call SSSSCCCCFFFFFFFFTTTT with any
  175.      particular values of _i_s_i_g_n and _s_c_a_l_e, the mathematical inverse function
  176.      is computed by calling CCCCSSSSFFFFFFFFTTTT with -_i_s_i_g_n and 1/(_n*_s_c_a_l_e).  In particular,
  177.      if you use _i_s_i_g_n = +1 and _s_c_a_l_e = 1.0 in SSSSCCCCFFFFFFFFTTTT for the forward FFT, you
  178.      can compute the inverse FFT by using CCCCSSSSFFFFFFFFTTTT with _i_s_i_g_n = -1 and
  179.      _s_c_a_l_e = 1.0/_n.
  180.  
  181.      See the NOTES section of this man page for information about the
  182.      interpretation of the data types described in the following arguments.
  183.  
  184.      These routines have the following arguments:
  185.  
  186.      _i_s_i_g_n     Integer.  (input)
  187.                Specifies whether to initialize the _t_a_b_l_e array or to do the
  188.                forward or inverse Fourier transform, as follows:
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  203.  
  204.  
  205.  
  206.                If _i_s_i_g_n = 0, the routine initializes the _t_a_b_l_e array and
  207.                returns.  In this case, the only arguments used or checked are
  208.                _i_s_i_g_n, _n, and _t_a_b_l_e.
  209.  
  210.                If _i_s_i_g_n = +1 or -1, the value of _i_s_i_g_n is the sign of the
  211.                exponent used in the FFT formula.
  212.  
  213.      _n         Integer.  (input)
  214.                Size of transform.  If _n is not positive, the routine returns
  215.                without calculating the transform.
  216.  
  217.      _s_c_a_l_e     Scale factor.  (input)
  218.                SSSSCCCCFFFFFFFFTTTT: Single precision.
  219.                DDDDZZZZFFFFFFFFTTTT: Double precision.
  220.                CCCCSSSSFFFFFFFFTTTT: Single precision.
  221.                ZZZZDDDDFFFFFFFFTTTT: Double precision.
  222.                Each element of the output array is multiplied by _s_c_a_l_e after
  223.                taking the Fourier transform, as defined in the preceding
  224.                formula.
  225.  
  226.      _x         Input array of values to be transformed. (input)
  227.                SSSSCCCCFFFFFFFFTTTT: Single precision array of dimension _n.
  228.                DDDDZZZZFFFFFFFFTTTT: Double precision array of dimension _n.
  229.                CCCCSSSSFFFFFFFFTTTT: Single precision complex array of dimension _n/2 + 1.
  230.                (input)
  231.                ZZZZDDDDFFFFFFFFTTTT: Double precision complex array of dimension _n/2 + 1.
  232.                (input)
  233.  
  234.      _y         Output array of transformed values. (output)
  235.                SSSSCCCCFFFFFFFFTTTT: Single precision complex array of dimension _n/2 + 1.
  236.                (input)
  237.                DDDDZZZZFFFFFFFFTTTT: Double precision complex array of dimension _n/2 + 1.
  238.                (input)
  239.                CCCCSSSSFFFFFFFFTTTT: Single precision array of dimension _n.
  240.                ZZZZDDDDFFFFFFFFTTTT: Double precision array of dimension _n.
  241.  
  242.                The output array, _y, is the FFT of the the input array, _x,
  243.                computed according to the preceding formula.  The output array
  244.                may be equivalenced to the input array in the calling program.
  245.                Be careful when dimensioning the arrays, in this case, to allow
  246.                for the fact that the complex array contains two (real) words
  247.                more than the real array.
  248.  
  249.      _t_a_b_l_e     Array of dimension (_n + _N_F_R) (input or output)
  250.                SSSSCCCCFFFFFFFFTTTT, CCCCSSSSFFFFFFFFTTTT: Single precision array.
  251.                DDDDZZZZFFFFFFFFTTTT, ZZZZDDDDFFFFFFFFTTTT: Double precision array.
  252.  
  253.                Table of factors and roots of unity.  See the description of
  254.                the _i_s_y_s argument for the value of _N_F_R.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  269.  
  270.  
  271.  
  272.                If _i_s_i_g_n = 0, the routine initializes _t_a_b_l_e (table is output
  273.                only).
  274.  
  275.                If _i_s_i_g_n = +1 or -1, the values in _t_a_b_l_e are assumed to be
  276.                initialized already by a prior call with _i_s_i_g_n = 0 (table is
  277.                input only).
  278.  
  279.      _w_o_r_k      Array of dimension _n + 2
  280.                SSSSCCCCFFFFFFFFTTTT, CCCCSSSSFFFFFFFFTTTT: Single precision array.
  281.                DDDDZZZZFFFFFFFFTTTT, ZZZZDDDDFFFFFFFFTTTT: Double precision array.
  282.  
  283.                Work array used for intermediate calculations.  Its address
  284.                space must be different from that of the input and output
  285.                arrays.
  286.  
  287.      _i_s_y_s      Integer array dimensioned 0000........_i_s_y_s((((0000)))).
  288.                An array that gives implementation-specific information.  All
  289.                features and functions of the FFT routines specific to any
  290.                particular implementation are confined to this _i_s_y_s array.
  291.  
  292.                In the Origin series implementation, _i_s_y_s((((0000))))====0000 and _i_s_y_s((((0000))))====1111
  293.                are supported.  In SCSL versions prior to 1.3, only _i_s_y_s((((0000))))====0000
  294.                was allowed. For _i_s_y_s((((0000))))====0000, _N_F_R====11115555, and for _i_s_y_s((((0000))))====1111, _N_F_R====222255556666.
  295.                The _N_F_R words of storage in the _t_a_b_l_e array contain a
  296.                factorization of the length of the transform.
  297.  
  298.                The smaller value of _N_F_R for _i_s_y_s((((0000))))====0000 is historical. It is too
  299.                small to store all the required factors for the highest
  300.                performing FFT, so when _i_s_y_s((((0000))))====0000, extra space is allocated
  301.                when the _t_a_b_l_e array is initialized. To avoid memory leaks,
  302.                this extra space must be deallocated when the _t_a_b_l_e array is no
  303.                longer needed. The SSSSCCCCFFFFFFFFTTTTFFFF routine is used to release this
  304.                memory. Due to the potential for memory leaks, the use of
  305.                _i_s_y_s((((0000))))====0000 should be avoided.
  306.  
  307.                For _i_s_y_s((((0000))))====1111, the value of _N_F_R is large enough so that no
  308.                extra memory needs to be allocated, and there is no need to
  309.                call SSSSCCCCFFFFFFFFTTTTFFFF to release memory. If called, it does nothing.
  310.  
  311.                NOTE: _i_s_y_s((((0000))))====1111 means that _i_s_y_s is an integer array with two
  312.                elements. The second element, _i_s_y_s((((1111)))), will not be accessed.
  313.  
  314. NNNNOOOOTTTTEEEESSSS
  315.      The following data types are described in this documentation:
  316.  
  317.           TTTTeeeerrrrmmmm UUUUsssseeeedddd                     DDDDaaaattttaaaa ttttyyyyppppeeee
  318.  
  319.      Fortran:
  320.  
  321.           Array dimensioned 0000........_n----1111      xxxx((((0000::::nnnn----1111))))
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  335.  
  336.  
  337.  
  338.           Array of dimensions (_m,_n)     xxxx((((mmmm,,,,nnnn))))
  339.  
  340.           Array of dimensions (_m,_n,_p)   xxxx((((mmmm,,,,nnnn,,,,pppp))))
  341.  
  342.           IIIInnnntttteeeeggggeeeerrrr                       IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  343.  
  344.           Single precision              RRRREEEEAAAALLLL
  345.  
  346.           Double precision              DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN
  347.  
  348.           Single precision complex      CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  349.  
  350.           Double precision complex      DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  351.  
  352.      C/C++:
  353.  
  354.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  355.  
  356.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  357.  
  358.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  359.  
  360.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  361.  
  362.           Single precision              ffffllllooooaaaatttt
  363.  
  364.           Double precision              ddddoooouuuubbbblllleeee
  365.  
  366.           Single precision complex      ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  367.  
  368.           Double precision complex      ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  369.  
  370.      C++ STL:
  371.  
  372.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  373.  
  374.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  375.  
  376.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  377.  
  378.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  379.  
  380.           Single precision              ffffllllooooaaaatttt
  381.  
  382.           Double precision              ddddoooouuuubbbblllleeee
  383.  
  384.           Single precision complex      ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  385.  
  386.           Double precision complex      ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  401.  
  402.  
  403.  
  404. CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS
  405.      Transform sizes with a prime factor exceeding 22223332222----1111 are not supported for
  406.      the 8-byte integer version of the library.
  407.  
  408.      In addition to the _w_o_r_k array, the FFT routines also dynamically allocate
  409.      scratch space from the stack. The amount of space allocated can be
  410.      slightly bigger than the size of the largest processor cache. For single
  411.      processor runs, the default stack size is large enough that these
  412.      allocations generally cause no problems. But for parallel runs, you need
  413.      to ensure that the stack size of slave threads is big enough to hold this
  414.      scratch space. Failure to reserve sufficient stack space will cause
  415.      programs to dump core due to stack overflows.  The stack size of MP
  416.      library slave threads is controlled via the MMMMPPPP____SSSSLLLLAAAAVVVVEEEE____SSSSTTTTAAAACCCCKKKKSSSSIIIIZZZZEEEE
  417.      environment variable or the mmmmpppp____sssseeeetttt____ssssllllaaaavvvveeee____ssssttttaaaacccckkkkssssiiiizzzzeeee(((()))) library routine. See
  418.      the mmmmpppp(3C), mmmmpppp(3F) and ppppeeee____eeeennnnvvvviiiirrrroooonnnn(5) reference pages for more information
  419.      on controlling the slave stack size. For pthreads applications, the
  420.      thread's stack size is specified as one of many creation attributes
  421.      provided in the pthread_attr_t argument to pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee(3P).  The
  422.      stacksize attribute should be set explicitly to a non-default value using
  423.      the pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____sssseeeettttssssttttaaaacccckkkkssssiiiizzzzeeee(3P) call, described in the
  424.      pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____iiiinnnniiiitttt(3P) man page.
  425.  
  426.      Care must be exercised if copies of the _t_a_b_l_e array are used: even though
  427.      a copy exists, the original must persist. As an example, the following
  428.      code will nnnnooootttt work:
  429.  
  430.           #include <scsl_fft.h>
  431.           float x[1024];
  432.           scsl_complex y[513];
  433.           float table[1024+256];
  434.           float work[1024+2];
  435.           int isys[2];
  436.           isys[0] = 1;
  437.           {
  438.              float table_orig[1024+256];
  439.  
  440.              scfft(0, 1024, 1.0f, x, y, table_orig, work, isys)
  441.              bcopy(table_orig, table, (1024+256)*sizeof(float));
  442.           }
  443.           scfft(1, 1024, 1.0f, x, y, table, work, isys)
  444.  
  445.  
  446.      In this example, because _t_a_b_l_e__o_r_i_g is a stack variable that does not
  447.      persist outside of the code block delimited by the braces, the data in
  448.      the copy, _t_a_b_l_e, are not guaranteed to be valid. However, the following
  449.      code will work because _t_a_b_l_e__o_r_i_g is persistent:
  450.  
  451.           #include <scsl_fft.h>
  452.           float x[1024];
  453.           scsl_complex y[513];
  454.           float table_orig[1024+256];
  455.           float table[1024+256];
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  467.  
  468.  
  469.  
  470.           float work[1024+2];
  471.           int isys[2];
  472.           isys[0] = 1;
  473.           scfft(0, 1024, 1.0f, x, y, table_orig, work, isys)
  474.           bcopy(table_orig, table, (1024+256)*sizeof(float));
  475.           scfft(1, 1024, 1.0f, x, y, table, work, isys)
  476.  
  477.  
  478. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  479.      These examples use the table and workspace sizes appropriate to Origin
  480.      series.
  481.  
  482.      Example 1:  Initialize the TTTTAAAABBBBLLLLEEEE array in preparation for doing an FFT of
  483.      size 1024.  In this case only the arguments _i_s_i_g_n, _n, and _t_a_b_l_e are used.
  484.      You can use dummy arguments or zeros for the other arguments in the
  485.      subroutine call.
  486.  
  487.      Fortran:
  488.  
  489.           REAL TABLE(1024+256)
  490.           INTEGER ISYS(0:1)
  491.           ISYS(0) = 1
  492.           CALL SCFFT(0, 1024, 0.0, DUMMY, DUMMY, TABLE, DUMMY, ISYS)
  493.  
  494.  
  495.      C/C++:
  496.  
  497.           #include <scsl_fft.h>
  498.           float table[1024+256];
  499.           int isys[2];
  500.           isys[0] = 1;
  501.           scfft(0, 1024, 0.0f, NULL, NULL, table, NULL, isys);
  502.  
  503.  
  504.      C++ STL:
  505.  
  506.           #include <complex.h>
  507.           #include <scsl_fft.h>
  508.           float table[1024+256];
  509.           int isys[2];
  510.           isys[0] = 1;
  511.           scfft(0, 1024, 0.0f, NULL, NULL, table, NULL, isys);
  512.  
  513.  
  514.      Example 2:  XXXX is a real array dimensioned (0...1023), and YYYY is a complex
  515.      array dimensioned (0...:512).  Take the FFT of XXXX and store the results in
  516.      YYYY.  Before taking the FFT, initialize the TTTTAAAABBBBLLLLEEEE array, as in example 1.
  517.  
  518.      Fortran:
  519.  
  520.           REAL X(0:1023)
  521.           COMPLEX Y(0:512)
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  533.  
  534.  
  535.  
  536.           REAL TABLE(1024+256)
  537.           REAL WORK(1024+2)
  538.           INTEGER ISYS(0:1)
  539.           ISYS(0) = 1
  540.           CALL SCFFT(0, 1024, 1.0, X, Y, TABLE, WORK, ISYS)
  541.           CALL SCFFT(1, 1024, 1.0, X, Y, TABLE, WORK, ISYS)
  542.  
  543.  
  544.      C/C++:
  545.  
  546.           #include <scsl_fft.h>
  547.           float x[1024];
  548.           scsl_complex y[513];
  549.           float table[1024+256];
  550.           float work[1024+2];
  551.           int isys[2];
  552.           isys[0] = 1;
  553.           scfft(0, 1024, 1.0f, x, y, table, work, isys)
  554.           scfft(1, 1024, 1.0f, x, y, table, work, isys)
  555.  
  556.  
  557.      C++ STL:
  558.  
  559.           #include <complex.h>
  560.           #include <scsl_fft.h>
  561.           float x[1024];
  562.           complex<float> y[513];
  563.           float table[1024+256];
  564.           float work[1024+2];
  565.           int isys[2];
  566.           isys[0] = 1;
  567.           scfft(0, 1024, 1.0f, x, y, table, work, isys)
  568.           scfft(1, 1024, 1.0f, x, y, table, work, isys)
  569.  
  570.  
  571.      Example 3:  With XXXX and YYYY as in example 2, take the inverse FFT of YYYY and
  572.      store it back in XXXX.  The _s_c_a_l_e factor 1/1024 is used.  Assume that the
  573.      TTTTAAAABBBBLLLLEEEE array is initialized already.
  574.  
  575.      Fortran:
  576.  
  577.           CALL CSFFT(-1, 1024, 1.0/1024.0, Y, X, TABLE, WORK, ISYS)
  578.  
  579.  
  580.      C/C++ and C++ STL:
  581.  
  582.           csfft(-1, 1024, 1.0f/1024.0f, y, x, table, work, isys)
  583.  
  584.  
  585.      Example 4:  Perform the same computation as in example 2, but equivalence
  586.      the input and output arrays to save storage space.  Use the 8-byte
  587.      integer version of SCSL.
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  599.  
  600.  
  601.  
  602.      Fortran:
  603.  
  604.           REAL X(0:1023)
  605.           COMPLEX Y(0:512)
  606.           EQUIVALENCE ( X(1), Y(1) )
  607.           REAL TABLE(1024+256)
  608.           REAL WORK(1024+2)
  609.           INTEGER*8 ISYS(0:1)
  610.           ISYS(0) = 1_8
  611.           CALL SCFFT(0_8, 1024_8, 1.0, X, Y, TABLE, WORK, ISYS)
  612.           CALL SCFFT(1_8, 1024_8, 1.0, X, Y, TABLE, WORK, ISYS)
  613.  
  614.  
  615.      C/C++:
  616.  
  617.           #include <scsl_fft_i8.h>
  618.           float *x;
  619.           scsl_complex y[513];
  620.           float table[1024+256];
  621.           float work[1024+2];
  622.           long long isys[2];
  623.           isys[0] = 1LL;
  624.           x = (float *) &y[0];
  625.           scfft(0LL, 1024LL, 1.0f, x, y, table, work, isys)
  626.           scfft(1LL, 1024LL, 1.0f, x, y, table, work, isys)
  627.  
  628.  
  629.      C++ STL:
  630.  
  631.           #include <complex.h>
  632.           #include <scsl_fft_i8.h>
  633.           float *x;
  634.           complex<float> y[513];
  635.           float table[1024+256];
  636.           float work[1024+2];
  637.           long long isys[2];
  638.           isys[0] = 1LL;
  639.           x = (float *) &y[0];
  640.           scfft(0LL, 1024LL, 1.0f, x, y, table, work, isys)
  641.           scfft(1LL, 1024LL, 1.0f, x, y, table, work, isys)
  642.  
  643.  
  644.      Example 5:  Perform the same computation as in example 2, but assume that
  645.      the lower bound of each Fortran array is 1, rather than 0.  The
  646.      subroutine calls are not changed.
  647.  
  648.      Fortran:
  649.  
  650.           REAL X(1024)
  651.           COMPLEX Y(513)
  652.           CALL SCFFT(0, 1024, 1.0, X, Y, TABLE, WORK, ISYS)
  653.           CALL SCFFT(1, 1024, 1.0, X, Y, TABLE, WORK, ISYS)
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            SSSSCCCCFFFFFFFFTTTT((((3333SSSS))))
  665.  
  666.  
  667.  
  668. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  669.      IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S), CCCCCCCCFFFFFFFFTTTT(3S), CCCCCCCCFFFFFFFFTTTTMMMM(3S), SSSSCCCCFFFFFFFFTTTTMMMM(3S)
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.                                                                        PPPPaaaaggggeeee 11111111
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.